package com.cnhis.cloudhealth.clidoctorweb.clibackadvice;

import java.util.Map;

import javax.ws.rs.FormParam;
import javax.ws.rs.POST;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import javax.ws.rs.core.MediaType;

import org.jboss.resteasy.logging.Logger;
import org.springframework.stereotype.Component;

import com.alibaba.dubbo.config.annotation.Reference;
import com.cnhis.cloudhealth.clinical.clidoctor.clibackadvice.service.ICliBackAdvice;
import com.cnhis.cloudhealth.commons.Mappers.ModelVo;
import java.util.HashMap;

@Path("clibackadvice")
@Component
public class CliBackAdviceRest {
	Logger log = Logger.getLogger(CliBackAdviceRest.class); 
	@Reference
	private ICliBackAdvice iCliBackAdvice;
	
	/**
	 * Clinic_Send_Advice_Blank
	 * 医嘱回退操作
	 * @param lXml
	 * @param lBCE03
	 * @param lBCE01
	 * @param lMember
	 * @return
	 * @throws Exception
	 */
	@SuppressWarnings({ "unchecked", "rawtypes" })
	@POST
	@Path("clinicsendadviceblank")
	@Produces({ MediaType.APPLICATION_JSON })
	public ModelVo clinicSendAdviceBlank(
			@FormParam("lXml") int lXml,
			@FormParam("lBCE03") String lBCE03,
			@FormParam("lBCE01") Integer lBCE01,
			@FormParam("lMember") Integer lMember
			) throws Exception{
		Map map = new HashMap();
		map.put("lXml", lXml);
		map.put("lBCE03", lBCE03);
		map.put("lBCE01", lBCE01);
		map.put("lMember", lMember);
		return iCliBackAdvice.clinicSendAdviceBlank(map);
	}
	
	/* ScriptId(7504) */
	/* Description(判断医嘱是否可以回退) */
	/**
	 * 
	 * @param lVAF06 就诊id
	 * @param lBCE01 医师或操作者id
	 * @param lMember
	 * 
	 * @param lcbm01
	 * @return
	 * @throws Exception
	 */
	@SuppressWarnings({ "unchecked", "rawtypes" })
	@POST
	@Path("judgebackadvice")
	@Produces({ MediaType.APPLICATION_JSON })
	public ModelVo  judgeBackAdvice(@FormParam("lVAF06") int lVAF06,
			@FormParam("lBCE01") int lBCE01,@FormParam("lMember") int lMember,
			@FormParam("lcbm01") int lcbm01
			)throws Exception{
		Map map = new HashMap();
		map.put("lVAF06", lVAF06);
		map.put("lBCE01", lBCE01);
		map.put("lMember", lMember);
		map.put("lcbm01", lcbm01);
		
		return iCliBackAdvice.judgeBackAdvice(map);
	}
}
